﻿@using SanQingShan.Helpers
@using SanQingShan.Models
@model SanQingShan.Models.CP_VISIT
           
@{
    ViewBag.Title = "Edit";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<script src="@Url.Content("~/Scripts/jquery-ui.js")" type="text/javascript"></script>

<div id="tabs">    
    <ul>
        @*<li><a href="#fragment-0"><span>基本信息</span></a></li>*@
        <li><a href="#fragment-1"><span>医嘱</span></a></li>  
        <li><a href="#fragment-2"><span>体征</span></a></li>
        <li><a href="#fragment-3"><span>检查</span></a></li>
        <li><a href="#fragment-4"><span>检验</span></a></li> 
        <li><a href="#fragment-5"><span>病历</span></a></li>
    </ul>

    @*<div id="fragment-0"> 
        <div class="editor-label">
            编号
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.CP_ID)
        </div>

        <div class="editor-label">
            入院时间
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.ADMISSION_TIME)
        </div>

        <div class="editor-label">
            出院时间
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.DISCHARGE_TIME)
        </div>

        <div class="editor-label">
            诊断
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.DIAGNOSIS)
        </div>   
         
        <div class="editor-label">
            费用
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.TOTAL_COSTS)
        </div>
        
@*        <div class="editor-label">
            多次就诊的就诊序号
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.VISIT_NO)
        </div>         
    </div>*@
    
    <div id="fragment-1">
        @{var grid1 = new WebGrid(AssociationHelper.GetOrders(Model.CP_ID, ViewBag.DbContext),canPage:false,canSort:false);
        <div>
        @grid1.GetHtml(
        tableStyle:"grid", 
        headerStyle: "head", 
        alternatingRowStyle: "alt",     
        columns: 
        grid1.Columns(
                grid1.Column("ORDER_TYPE_ID","类型"),
                grid1.Column("ORDER_CONTENT","医嘱"),
                grid1.Column("DOSAGE", "剂量"),
                grid1.Column("UNIT", "剂量单位"),
                grid1.Column(header:"频率",format:@<span>@item.FREQ@*@item.FREQ_UNIT*@</span>),
                grid1.Column("METHOD","给药途径"),
                grid1.Column("START_TIME","开始时间"),
                grid1.Column("END_TIME","结束时间")
                //grid1.Column("REAL_EXECUTIVE_TIME","执行时间")
        )    
        ) 
        </div>
        }
    </div>
    
    <div id="fragment-2">
        @{var grid2 = new WebGrid(AssociationHelper.GetVitalSigns(Model.CP_ID, ViewBag.DbContext), canPage: false, canSort: false);
        <div>
        @grid2.GetHtml(
        tableStyle:"grid", 
        headerStyle: "head", 
        alternatingRowStyle: "alt",     
        columns: 
        grid2.Columns(
                grid2.Column("VITAL_SIGN_NAME","体征"),
                grid2.Column("RESULT_VALUE","值"),
                grid2.Column("RESULT_UNIT", "单位"),
                grid2.Column("MEASURING_TIME", "测量时间")
        )    
        ) 
        </div>
        }
    </div>  

    <div id="fragment-3">
        @{var grid3 = new WebGrid(AssociationHelper.GetExams(Model.CP_ID, ViewBag.DbContext), canPage: false, canSort: false);
        <div>
        @grid3.GetHtml(
        tableStyle:"grid", 
        headerStyle: "head", 
        alternatingRowStyle: "alt",     
        columns: 
        grid3.Columns(
                grid2.Column("EXAM_CLASS","模态"),
                grid2.Column("EXAM_SUB_CLASS","部位"),
                grid2.Column("RESULT_PARAGRAPH", "标题"),
                grid2.Column("RESULT_DESCRIPTION", "所见"),
                grid2.Column("RESULT_IMPRESSION", "结论"),
                grid2.Column("EXAM_TIME", "检查时间")
        )    
        ) 
        </div>
        }
    </div>
   
    <div id="fragment-4">   
        @{var grid4 = new WebGrid(AssociationHelper.GetLabTests(Model.CP_ID, ViewBag.DbContext), canPage: false, canSort: false);
        <div>
        @grid4.GetHtml(
        tableStyle:"grid", 
        headerStyle: "head", 
        alternatingRowStyle: "alt",     
        columns: 
        grid4.Columns(
        grid4.Column("REPORT_ITEM_NAME","检验项目"),
        grid4.Column("RESULT_VALUE","值"),
        grid4.Column("RESULT_UNIT", "单位"),
        grid4.Column("ABNORMAL_INDICATOR", "异常标记"),
        @*grid4.Column(format:@<span>@item.TEST_NO.GetHashCode()</span>, header:"所属化验单编号"),*@
        grid4.Column("TEST_NO", header: "所属化验单编号"),
        grid4.Column("ITEM_NO", "项目编号"),
        grid4.Column("REPORT_TIME", "化验时间")
        )                 
        ) 
        </div>
        }     
    </div>
    
    <div id="fragment-5">
        @{var grid5 = new WebGrid(AssociationHelper.GetMedicalDocs(Model.CP_ID, ViewBag.DbContext), canPage: false, canSort: false);
        <div>
        @grid5.GetHtml(
        tableStyle: "grid",
        headerStyle: "head",
        alternatingRowStyle: "alt",
        columns:
        grid5.Columns(
                grid5.Column("FULL_PATH", "路径"),
                grid5.Column("FILE_EXTENSION", "文档类型"),
                grid5.Column(format: @<a href="@item.FilePath">浏览</a>)
        )
        ) 
        </div>
        }  
    </div>

    <script type="text/javascript">        $("#tabs").tabs();</script>
</div> 
